// 这里没有解决跨域问题，但可以通过后解决跨域问题在后端的Controller层使用@CrossOrigin
import request from '../utils/request'

export function getExportGoodsList(exportId) {
  return request({
    url: '/exportGoods',
    method: 'get',
    params: {
      exportId: exportId
    }
  })
}


export function addExportGoods(data) {
  return request({
    url: '/exportGoods/add',
    method: 'post',
    params: {
      exportId: data.exportId,
      goods_id: data.goods_id,
      num: data.num,
      unit_price: data.unit_price
    }
  })
}

export function deleteExportGoods(exportId) {
  return request({
    url: '/exportGoods/delete',
    method: 'post',
    params: {
      exportId: exportId
    }
  })
}


export function editExportGoods(data) {
  return request({
    url: '/exportGoods/edit',
    method: 'post',
    params: {
      EG_id: data.eg_id,
      exportId: data.exportId,
      goods_id: data.goods_id,
      num: data.num,
      unit_price: data.unit_price
    }
  })
}
